package com.kkb.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;

/**
 * @Author: 平川
 * @Description:
 * @Date Created in 2021-09-19 21:25
 * @Modified By:
 */
@ControllerAdvice
public class GlobelException {
    @ExceptionHandler(value = TeamIdException.class)
    public ModelAndView exception4(Exception ex){
        ModelAndView mv = new ModelAndView();
        mv.setViewName("error1");
        return mv;
    }
    @ExceptionHandler(value = TeamNameException.class)
    public ModelAndView exception5(Exception ex){
        ModelAndView mv = new ModelAndView();
        mv.setViewName("error2");
        return mv;
    }
    @ExceptionHandler(value = Exception.class)
    public ModelAndView exception6(Exception ex){
        ModelAndView mv = new ModelAndView();
        mv.setViewName("error3");
        return mv;
    }
}
